/*
* File: http.h
* Version: 1.0
* Last modified on 2014-03-18 15:00
* Contributors : Nicklas Wallman (s131448), Olof Ivarsson(s132046), Oscar Ernstsson(s132952), Oscar Pehrson(s131469), Martin Jakobsson(s133082)
*/
#ifndef _http_h
#define _http_h

#include <time.h>

#define HTTP_OK 200	
#define HTTP_NOT_FOUND 404
#define HTTP_NOT_MODIFIED 304


typedef struct
{
	char *command;
	char *fileName;
	char *protocol;
	char *conditionalDate;
	char *requestDate;
} httpRequestT;

struct fileInfoT
{
	int fileSize;
	int returncode;
	char *mimeType;
	tm *lastModified;
};

typedef struct
{
	char *content;
	struct fileInfoT fileInfo;
} fileContentT;


int parseHTTP(SOCKET s,httpRequestT *httpRequest);
int sendPageToClient(SOCKET s,httpRequestT httpRequest,int *returnCode);

#endif